package com.cloud.controller;

import com.cloud.pojo.sys.Result;
import com.cloud.pojo.user.UserInfo;
import com.cloud.service.LoginService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * @version v1.0
 * @author: TianXiang
 * @description:
 * @date: 2020/10/21
 */
@RestController
@RequestMapping("/login")
public class LoginController {

    @Resource
    private LoginService loginService;

    @PostMapping("/register")
    public Result register(@RequestBody UserInfo userInfo) {
        return Result.createSuccess("注册成功, 使用前特别注意: 一天内只能对微信操作一次以下动作(切换帐号或者退出登录)否则会导致帐号登录异常", loginService.register(userInfo));
    }

}
